home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume23 / xenix-gnu / part02 < prev    next >
Encoding:
Text File  |  1991-09-27  |  49.1 KB  |  1,734 lines

  1. Newsgroups: comp.sources.misc
  2. From: steve@robobar.co.uk (Steve Bleazard)
  3. Subject:  v23i029:  xenix-gnu - Xenix 386 patchkit for GCC / GAS and GDB, Part02/03
  4. Message-ID: <1991Sep27.045947.16068@sparky.imd.sterling.com>
  5. X-Md4-Signature: 3354e5389895d7771f01f8d3006c86e1
  6. Date: Fri, 27 Sep 1991 04:59:47 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: steve@robobar.co.uk (Steve Bleazard)
  10. Posting-number: Volume 23, Issue 29
  11. Archive-name: xenix-gnu/part02
  12. Environment: SCOXENIX
  13.  
  14. #! /bin/sh
  15. # This is a shell archive.  Remove anything before this line, then feed it
  16. # into a shell via "sh file" or similar.  To overwrite existing files,
  17. # type "sh file -c".
  18. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  19. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  20. # Contents:  gdb-3.5b.pch
  21. # Wrapped by kent@sparky on Thu Sep 26 23:30:11 1991
  22. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  23. echo If this archive is complete, you will see the following message:
  24. echo '          "shar: End of archive."'
  25. if test -f 'gdb-3.5b.pch' -a "${1}" != "-c" ; then 
  26.   echo shar: Will not clobber existing file \"'gdb-3.5b.pch'\"
  27. else
  28.   echo shar: Extracting \"'gdb-3.5b.pch'\" \(46618 characters\)
  29.   sed "s/^X//" >'gdb-3.5b.pch' <<'END_OF_FILE'
  30. X*** 3.5/Makefile.dist    Wed Jan 31 03:42:57 1990
  31. X--- Makefile.dist    Thu Aug  1 18:01:18 1991
  32. X***************
  33. X*** 124,130 ****
  34. X       kdb-start.c main.c printcmd.c \
  35. X       remote.c source.c stack.c standalone.c stuff.c symmisc.c symtab.c \
  36. X       utils.c valarith.c valops.c valprint.c values.c version.c expread.y \
  37. X!      xgdb.c
  38. X  
  39. X  DEPFILES = umax-dep.c gould-dep.c default-dep.c sun3-dep.c \
  40. X         sparc-dep.c hp9k320-dep.c hp300bsd-dep.c news-dep.c i386-dep.c \
  41. X--- 124,130 ----
  42. X       kdb-start.c main.c printcmd.c \
  43. X       remote.c source.c stack.c standalone.c stuff.c symmisc.c symtab.c \
  44. X       utils.c valarith.c valops.c valprint.c values.c version.c expread.y \
  45. X!      x386dbx.c xgdb.c
  46. X  
  47. X  DEPFILES = umax-dep.c gould-dep.c default-dep.c sun3-dep.c \
  48. X         sparc-dep.c hp9k320-dep.c hp300bsd-dep.c news-dep.c i386-dep.c \
  49. X***************
  50. X*** 173,179 ****
  51. X  
  52. X  OBS = main.o blockframe.o breakpoint.o findvar.o stack.o source.o \
  53. X      values.o eval.o valops.o valarith.o valprint.o printcmd.o \
  54. X!     symtab.o symmisc.o coffread.o dbxread.o infcmd.o infrun.o remote.o \
  55. X      command.o utils.o expread.o expprint.o pinsn.o environ.o version.o \
  56. X      copying.o ${READLINEOBS}
  57. X  
  58. X--- 173,179 ----
  59. X  
  60. X  OBS = main.o blockframe.o breakpoint.o findvar.o stack.o source.o \
  61. X      values.o eval.o valops.o valarith.o valprint.o printcmd.o \
  62. X!     symtab.o symmisc.o coffread.o dbxread.o x386dbx.o infcmd.o infrun.o remote.o \
  63. X      command.o utils.o expread.o expprint.o pinsn.o environ.o version.o \
  64. X      copying.o ${READLINEOBS}
  65. X  
  66. X*** 3.5/config.gdb    Tue Jan 30 21:35:46 1990
  67. X--- config.gdb    Thu Aug  1 19:36:23 1991
  68. X***************
  69. X*** 326,331 ****
  70. X--- 326,337 ----
  71. X      pinsnfile=three
  72. X      opcodefile=four
  73. X      ;;
  74. X+ xenix386)
  75. X+     makedefine="-DM_CLIBS=-lx -DM_REGEX=regex.o -Dcc=gcc -DM_CFLAGS=-traditional"
  76. X+     pinsnfile=i386-pinsn.c
  77. X+     opcodefile=m-xenix386.h
  78. X+     depfile=i386-dep.c    # patched with #ifdef M_XENIX
  79. X+     ;;
  80. X  *)
  81. X      echo "Unknown machine type: \`$machine'"
  82. X      echo "Available types:"
  83. X***************
  84. X*** 369,375 ****
  85. X  # edit the makefile
  86. X  echo "Editing Makefile"
  87. X  cp Makefile.dist tmp.c
  88. X! cc -E >Makefile tmp.c $makedefine -DM_MAKEDEFINE="$makedefine"
  89. X  rm -f tmp.c
  90. X  
  91. X  echo "GDB is now set up for use with a $machine." \
  92. X--- 375,381 ----
  93. X  # edit the makefile
  94. X  echo "Editing Makefile"
  95. X  cp Makefile.dist tmp.c
  96. X! gcc -Ui386 -E >Makefile $makedefine -DM_MAKEDEFINE="$makedefine" tmp.c
  97. X  rm -f tmp.c
  98. X  
  99. X  echo "GDB is now set up for use with a $machine." \
  100. X*** 3.5/core.c    Thu Jan 11 00:55:17 1990
  101. X--- core.c    Thu Aug  1 18:01:22 1991
  102. X***************
  103. X*** 49,54 ****
  104. X--- 49,59 ----
  105. X  #ifdef UMAX_CORE
  106. X  #include <sys/ptrace.h>
  107. X  #else
  108. X+ #ifdef M_XENIX
  109. X+ struct user; struct buf; struct inode; struct proc;    /* inhibit warnings */
  110. X+ #include <sys/page.h>
  111. X+ #include <sys/seg.h>
  112. X+ #endif
  113. X  #include <sys/user.h>
  114. X  #endif
  115. X  
  116. X***************
  117. X*** 62,70 ****
  118. X--- 67,79 ----
  119. X  
  120. X  #ifndef COFF_FORMAT
  121. X  #ifndef AOUTHDR
  122. X+ #ifdef M_XENIX
  123. X+ #define AOUTHDR        struct xexec
  124. X+ #else
  125. X  #define AOUTHDR        struct exec
  126. X  #endif
  127. X  #endif
  128. X+ #endif
  129. X  
  130. X  extern char *sys_siglist[];
  131. X  
  132. X***************
  133. X*** 200,209 ****
  134. X         the core file, (s)he'll find out soon enough.  */
  135. X      return;
  136. X  
  137. X        if (N_MAGIC (core_aouthdr) != 0
  138. X        && bcmp (&core_aouthdr, &exec_aouthdr, sizeof core_aouthdr))
  139. X      printf ("Warning: core file does not match specified executable file.\n");
  140. X!       else if (exec_mtime > st_core.st_mtime)
  141. X      printf ("Warning: exec file is newer than core file.\n");
  142. X      }
  143. X  }
  144. X--- 209,222 ----
  145. X         the core file, (s)he'll find out soon enough.  */
  146. X      return;
  147. X  
  148. X+ /* cannot validate core file against executable file on xenix */
  149. X+ #ifndef M_XENIX
  150. X        if (N_MAGIC (core_aouthdr) != 0
  151. X        && bcmp (&core_aouthdr, &exec_aouthdr, sizeof core_aouthdr))
  152. X      printf ("Warning: core file does not match specified executable file.\n");
  153. X!       else
  154. X! #endif
  155. X!       if (exec_mtime > st_core.st_mtime)
  156. X      printf ("Warning: exec file is newer than core file.\n");
  157. X      }
  158. X  }
  159. X*** 3.5/dbxread.c    Sat Jan 27 08:30:54 1990
  160. X--- dbxread.c    Thu Aug  1 19:25:46 1991
  161. X***************
  162. X*** 40,45 ****
  163. X--- 40,60 ----
  164. X  #define L_INCR 1
  165. X  #endif
  166. X  
  167. X+ #ifdef M_XENIX
  168. X+ #include <sys/relsym.h>
  169. X+ #define nlist xenix_nlist    /* the system nlist is broken */
  170. X+ #include <a.out.h>
  171. X+ #undef nlist
  172. X+ #define nlist gas_nlist
  173. X+ #include "stab.gnu.h"
  174. X+ #include "gas-nlist.h"
  175. X+ 
  176. X+ #define STRING_SEG 4
  177. X+ #define SYMS_SEG   5
  178. X+ #define AOUTHDR    struct xexec
  179. X+ 
  180. X+ #else /* M_XENIX */
  181. X+ 
  182. X  #ifdef COFF_ENCAPSULATE
  183. X  #include "a.out.encap.h"
  184. X  #include "stab.gnu.h"
  185. X***************
  186. X*** 47,52 ****
  187. X--- 62,69 ----
  188. X  #include <a.out.h>
  189. X  #include <stab.h>
  190. X  #endif
  191. X+ #endif /* M_XENIX */
  192. X+ 
  193. X  #include <ctype.h>
  194. X  
  195. X  #ifndef NO_GNU_STABS
  196. X***************
  197. X*** 167,172 ****
  198. X--- 184,222 ----
  199. X  /* C++ */
  200. X  static struct type **read_args ();
  201. X  
  202. X+ #ifdef M_XENIX
  203. X+ extern struct xseg *find_segment();
  204. X+ #define NUMBER_OF_SYMBOLS \
  205. X+   ({ struct xseg *cseg; long z;\
  206. X+      cseg = find_segment(XS_TSYMS, SYMS_SEG); \
  207. X+      z = cseg ? cseg->xs_psize / sizeof(struct nlist) : 0; z;})
  208. X+ #define SYMBOL_TABLE_OFFSET \
  209. X+   ({ struct xseg *cseg; long z;\
  210. X+      cseg = find_segment(XS_TSYMS, SYMS_SEG); \
  211. X+      z = cseg ? cseg->xs_filpos : 0; z;})
  212. X+ #define STRING_TABLE_OFFSET \
  213. X+   ({ struct xseg *cseg; long z;\
  214. X+      cseg = find_segment(XS_TSYMS, STRING_SEG); \
  215. X+      z = cseg ? cseg->xs_filpos : 0; z; })
  216. X+ #define READ_STRING_TABLE_SIZE(INTO)        \
  217. X+   { struct xseg *cseg; \
  218. X+      cseg = find_segment(XS_TSYMS, STRING_SEG); \
  219. X+      INTO = cseg ? cseg->xs_psize : 0; }
  220. X+ #define N_BADMAG(hdr)\
  221. X+   (hdr.x_magic != X_MAGIC && (hdr.x_cpu & XC_CPU) != XC_386 \
  222. X+    && (hdr.x_renv & XE_SEG) == 0  && (hdr.x_renv & XE_EXEC) == 0)
  223. X+ #define READ_FILE_HEADERS(DESC, NAME)        \
  224. X+ { val = myread (DESC, &hdr, sizeof hdr);    \
  225. X+   if (val < 0) perror_with_name (NAME);        \
  226. X+   if (N_BADMAG (hdr))                \
  227. X+     error ("File \"%s\" not in executable format.", NAME);\
  228. X+   process_a_out(DESC, NAME); }
  229. X+ #define IS_OBJECT_FILE 0
  230. X+ #define SIZE_OF_TEXT_SEGMENT hdr.x_text
  231. X+ #define ADDR_OF_TEXT_SEGMENT 0
  232. X+ #define ENTRY_POINT hdr.x_entry
  233. X+ #endif
  234. X+ 
  235. X  /* Macro to determine which symbols to ignore when reading the first symbol
  236. X     of a file.  Some machines override this definition. */
  237. X  #ifdef N_NSYMS
  238. X***************
  239. X*** 336,341 ****
  240. X--- 386,394 ----
  241. X  /* Count symbols as they are processed, for error messages.  */
  242. X  
  243. X  static int symnum;
  244. X+ #ifdef M_XENIX
  245. X+ static long lsym_count = 0;
  246. X+ #endif /* M_XENIX */
  247. X  
  248. X  /* Vector of types defined so far, indexed by their dbx type numbers.
  249. X     (In newer sun systems, dbx uses a pair of numbers in parens,
  250. X***************
  251. X*** 1627,1632 ****
  252. X--- 1680,1691 ----
  253. X    old_chain = make_cleanup (close, desc);
  254. X    make_cleanup (free_current_contents, &name);
  255. X  
  256. X+ #ifdef M_XENIX
  257. X+ /* On xenix (with gcc) READ_FILE_HEADER reads the segment table,
  258. X+  * fileinfo table and global symbol table as well. 
  259. X+  */
  260. X+ #endif /* M_XENIX */
  261. X+ 
  262. X    READ_FILE_HEADERS (desc, name);
  263. X  
  264. X    entry_point = ENTRY_POINT;
  265. X***************
  266. X*** 1676,1681 ****
  267. X--- 1735,1744 ----
  268. X    val = myread (desc, stringtab, buffer);
  269. X    if (val < 0)
  270. X      perror_with_name (name);
  271. X+ #ifdef X_DEBUG
  272. X+     printf("\nstring table offset = %d, size = %d, start = %s\n",
  273. X+         STRING_TABLE_OFFSET, buffer, stringtab);
  274. X+ #endif
  275. X    
  276. X    /* Throw away the old symbol table.  */
  277. X  
  278. X***************
  279. X*** 1720,1726 ****
  280. X--- 1783,1793 ----
  281. X  
  282. X    /* Go over the misc functions and install them in vector.  */
  283. X  
  284. X+ #ifndef M_XENIX /* This has already been done at header read time */
  285. X    condense_misc_bunches (0);
  286. X+ #else
  287. X+   process_global_symbol_table(desc, name);
  288. X+ #endif /* M_XENIX */
  289. X  
  290. X    /* Don't allow char * to have a typename (else would get caddr_t.)  */
  291. X  
  292. X***************
  293. X*** 1799,1805 ****
  294. X  {
  295. X    if (symbuf_idx == symbuf_end)
  296. X      fill_symbuf ();
  297. X!   symnum++;
  298. X    return symbuf[symbuf_idx++].n_un.n_strx + stringtab_global;
  299. X  }
  300. X  
  301. X--- 1866,1872 ----
  302. X  {
  303. X    if (symbuf_idx == symbuf_end)
  304. X      fill_symbuf ();
  305. X!   symnum++;  lsym_count--;
  306. X    return symbuf[symbuf_idx++].n_un.n_strx + stringtab_global;
  307. X  }
  308. X  
  309. X***************
  310. X*** 1937,1942 ****
  311. X--- 2004,2019 ----
  312. X    int global_funs = 0;
  313. X  #endif
  314. X  
  315. X+ #ifdef M_XENIX
  316. X+   long flsym_count = 0;
  317. X+   long file_string_base = 0;
  318. X+   long stringtab_offset = 0;
  319. X+   long symtab_pos = 0;
  320. X+   long filadd = 0;
  321. X+   long textsize = 0;
  322. X+   int file_count = 0;
  323. X+ #endif /* M_XENIX */
  324. X+ 
  325. X    /* Current partial symtab */
  326. X    struct partial_symtab *pst;
  327. X  
  328. X***************
  329. X*** 1989,1998 ****
  330. X--- 2066,2123 ----
  331. X    symtab_input_desc = desc;    /* This is needed for fill_symbuf below */
  332. X    symbuf_end = symbuf_idx = 0;
  333. X  
  334. X+ #ifdef M_XENIX
  335. X+   init_fileinfo_processing();   /* start processing the list of files */
  336. X+   nlistlen += 10;         /* force the hack code to terminate the loop */
  337. X+   lsym_count = 0;
  338. X+ #endif /* M_XENIX */
  339. X+ 
  340. X    for (symnum = 0; symnum < nlistlen; symnum++)
  341. X      {
  342. X        /* Get the symbol for this run and pull out some info */
  343. X        QUIT;    /* allow this to be interruptable */
  344. X+ #ifdef M_XENIX
  345. X+ 
  346. X+       /* This is a gross hack.  Xenix places pointers to each files $$SYMBOLS
  347. X+        * (containing the symbols for DBX) and $$TYPES (containing the strings
  348. X+        * for DBX) in the file name table.  There is also a partial symbol
  349. X+        * table record for each file produced by the loader - this is ignored
  350. X+        * at present.
  351. X+        */
  352. X+        if (lsym_count == 0)
  353. X+        {
  354. X+      try_next_file:
  355. X+      if (!get_next_fileinfo(&stringtab_offset, &flsym_count, &filadd,
  356. X+                             &symtab_pos, &textsize))
  357. X+      {            /* all files proccessed */
  358. X+        symnum = nlistlen;
  359. X+        continue;
  360. X+      }
  361. X+      else
  362. X+      {
  363. X+        lseek(desc, symtab_pos, 0);
  364. X+          stringtab_global = stringtab + stringtab_offset;
  365. X+        symbuf_idx = symbuf_end;  /* force symbol reading */
  366. X+        lsym_count = flsym_count;
  367. X+      }
  368. X+      
  369. X+      file_count++;
  370. X+ 
  371. X+      if (file_count == 2)
  372. X+            startup_file_start = filadd;
  373. X+ 
  374. X+      if (file_count == 3)
  375. X+            startup_file_end = filadd;
  376. X+ 
  377. X+          if (lsym_count == 0)    /* skip this file if no symbols in it */
  378. X+        goto try_next_file;
  379. X+ 
  380. X+        }
  381. X+ 
  382. X+        
  383. X+        lsym_count--;
  384. X+ 
  385. X+ #endif /* M_XENIX */
  386. X        if (symbuf_idx == symbuf_end)
  387. X      fill_symbuf ();
  388. X        bufp = &symbuf[symbuf_idx++];
  389. X***************
  390. X*** 2023,2029 ****
  391. X    if (bufp->n_un.n_strx < 0 || bufp->n_un.n_strx >= stringtab_size)  \
  392. X      error ("Invalid symbol data: bad string table offset: %d",       \
  393. X         bufp->n_un.n_strx);                                       \
  394. X!   namestring = bufp->n_un.n_strx + stringtab
  395. X  
  396. X  #define    ADD_PSYMBOL_TO_LIST(NAME, NAMELENGTH, NAMESPACE, CLASS, LIST, VALUE)\
  397. X    do {                                        \
  398. X--- 2148,2154 ----
  399. X    if (bufp->n_un.n_strx < 0 || bufp->n_un.n_strx >= stringtab_size)  \
  400. X      error ("Invalid symbol data: bad string table offset: %d",       \
  401. X         bufp->n_un.n_strx);                                       \
  402. X!   namestring = bufp->n_un.n_strx + stringtab + stringtab_offset
  403. X  
  404. X  #define    ADD_PSYMBOL_TO_LIST(NAME, NAMELENGTH, NAMESPACE, CLASS, LIST, VALUE)\
  405. X    do {                                        \
  406. X***************
  407. X*** 2051,2062 ****
  408. X      SYMBOL_VALUE (psym) = (VALUE);                     \
  409. X    } while (0);
  410. X  
  411. X  
  412. X!       switch (bufp->n_type)
  413. X      {
  414. X        /*
  415. X         * Standard, non-debugger, symbols
  416. X         */
  417. X  
  418. X      case N_TEXT | N_EXT:
  419. X        /* Catch etext */
  420. X--- 2176,2193 ----
  421. X      SYMBOL_VALUE (psym) = (VALUE);                     \
  422. X    } while (0);
  423. X  
  424. X+ #ifdef X_DEBUG
  425. X+ printf("%s = (%#x, %d, %#x)\n",
  426. X+   bufp->n_un.n_strx ? bufp->n_un.n_strx+stringtab+stringtab_offset : "<NONE>",
  427. X+   (unsigned char)bufp->n_type, bufp->n_desc, bufp->n_value);
  428. X+ #endif /* X_DEBUG */
  429. X  
  430. X!       switch ((unsigned char)bufp->n_type)
  431. X      {
  432. X        /*
  433. X         * Standard, non-debugger, symbols
  434. X         */
  435. X+ #ifndef M_XENIX            /* these are not present with Xenix / GCC */
  436. X  
  437. X      case N_TEXT | N_EXT:
  438. X        /* Catch etext */
  439. X***************
  440. X*** 2176,2181 ****
  441. X--- 2307,2314 ----
  442. X      case N_NBBSS:
  443. X  #endif
  444. X  
  445. X+ #endif /* M_XENIX */
  446. X+ 
  447. X        /* Keep going . . .*/
  448. X  
  449. X        /*
  450. X***************
  451. X*** 2209,2218 ****
  452. X--- 2342,2358 ----
  453. X  
  454. X        if (pst && past_first_source_file)
  455. X          {
  456. X+ #ifndef M_XENIX
  457. X            end_psymtab (pst, psymtab_include_list, includes_used,
  458. X                 symnum * sizeof (struct nlist), bufp->n_value,
  459. X                 dependency_list, dependencies_used,
  460. X                 global_psymbols.next, static_psymbols.next);
  461. X+ #else
  462. X+           end_psymtab (pst, psymtab_include_list, includes_used,
  463. X+                symtab_pos + flsym_count * sizeof (struct nlist),
  464. X+                bufp->n_value, dependency_list, dependencies_used,
  465. X+                global_psymbols.next, static_psymbols.next);
  466. X+ #endif
  467. X            pst = (struct partial_symtab *) 0;
  468. X            includes_used = 0;
  469. X            dependencies_used = 0;
  470. X***************
  471. X*** 2220,2228 ****
  472. X--- 2360,2374 ----
  473. X        else
  474. X          past_first_source_file = 1;
  475. X  
  476. X+ #ifndef M_XENIX
  477. X        pst = start_psymtab (namestring, bufp->n_value,
  478. X                     symnum * sizeof (struct nlist),
  479. X                     global_psymbols.next, static_psymbols.next);
  480. X+ #else
  481. X+       pst = start_psymtab (namestring, bufp->n_value, symtab_pos,
  482. X+                    global_psymbols.next, static_psymbols.next,
  483. X+                    stringtab_offset, flsym_count, textsize);
  484. X+ #endif /* M_XENIX */
  485. X  
  486. X        continue;
  487. X  
  488. X***************
  489. X*** 2591,2596 ****
  490. X--- 2737,2743 ----
  491. X      }
  492. X  
  493. X    /* If there's stuff to be cleaned up, clean it up.  */
  494. X+ #ifndef M_XENIX
  495. X    if (entry_point < bufp->n_value
  496. X        && entry_point >= last_o_file_start)
  497. X      {
  498. X***************
  499. X*** 2597,2609 ****
  500. X--- 2744,2764 ----
  501. X        startup_file_start = last_o_file_start;
  502. X        startup_file_end = bufp->n_value;
  503. X      }
  504. X+ #endif /* M_XENIX */
  505. X  
  506. X    if (pst)
  507. X      {
  508. X+ #ifndef M_XENIX
  509. X        end_psymtab (pst, psymtab_include_list, includes_used,
  510. X             symnum * sizeof (struct nlist), end_of_text_addr,
  511. X             dependency_list, dependencies_used,
  512. X             global_psymbols.next, static_psymbols.next);
  513. X+ #else /* M_XENIX */
  514. X+       end_psymtab (pst, psymtab_include_list, includes_used,
  515. X+            symtab_pos + flsym_count * sizeof (struct nlist),
  516. X+            end_of_text_addr, dependency_list, dependencies_used,
  517. X+            global_psymbols.next, static_psymbols.next);
  518. X+ #endif /* M_XENIX */
  519. X        includes_used = 0;
  520. X        dependencies_used = 0;
  521. X        pst = (struct partial_symtab *) 0;
  522. X***************
  523. X*** 2653,2658 ****
  524. X--- 2808,2814 ----
  525. X   * completely filled at the end of the symbol list.
  526. X   */
  527. X  static struct partial_symtab *
  528. X+ #ifndef M_XENIX
  529. X  start_psymtab (filename, textlow, ldsymoff, global_syms, static_syms)
  530. X       char *filename;
  531. X       int textlow;
  532. X***************
  533. X*** 2659,2664 ****
  534. X--- 2815,2832 ----
  535. X       int ldsymoff;
  536. X       struct partial_symbol *global_syms;
  537. X       struct partial_symbol *static_syms;
  538. X+ #else
  539. X+ start_psymtab (filename, textlow, ldsymoff, global_syms, static_syms, stroffset,
  540. X+            symcount, textsize)
  541. X+      char *filename;
  542. X+      int textlow;
  543. X+      int ldsymoff;
  544. X+      struct partial_symbol *global_syms;
  545. X+      struct partial_symbol *static_syms;
  546. X+      int stroffset;
  547. X+      int symcount;
  548. X+      long textsize;
  549. X+ #endif
  550. X  {
  551. X    struct partial_symtab *result =
  552. X      (struct partial_symtab *) obstack_alloc (psymbol_obstack,
  553. X***************
  554. X*** 2671,2677 ****
  555. X  
  556. X    result->textlow = textlow;
  557. X    result->ldsymoff = ldsymoff;
  558. X! 
  559. X    result->readin = 0;
  560. X  
  561. X    result->globals_offset = global_syms - global_psymbols.list;
  562. X--- 2839,2848 ----
  563. X  
  564. X    result->textlow = textlow;
  565. X    result->ldsymoff = ldsymoff;
  566. X! #ifdef M_XENIX
  567. X!   result->texthigh = textlow + textsize;
  568. X!   result->ldsymlen = symcount * sizeof(struct nlist);
  569. X! #endif
  570. X    result->readin = 0;
  571. X  
  572. X    result->globals_offset = global_syms - global_psymbols.list;
  573. X***************
  574. X*** 2679,2684 ****
  575. X--- 2850,2856 ----
  576. X  
  577. X    result->n_global_syms = 0;
  578. X    result->n_static_syms = 0;
  579. X+   result->stringtab_off = stroffset;
  580. X  
  581. X    return result;
  582. X  }
  583. X***************
  584. X*** 2722,2729 ****
  585. X--- 2894,2903 ----
  586. X  {
  587. X    int i;
  588. X  
  589. X+ #ifndef M_XENIX
  590. X    pst->ldsymlen = capping_symbol_offset - pst->ldsymoff;
  591. X    pst->texthigh = capping_text;
  592. X+ #endif /* M_XENIX */
  593. X  
  594. X    pst->n_global_syms =
  595. X      capping_global - (global_psymbols.list + pst->globals_offset);
  596. X***************
  597. X*** 2830,2840 ****
  598. X--- 3004,3023 ----
  599. X        old_chain = make_cleanup (really_free_pendings, 0);
  600. X  
  601. X        /* Read in this files symbols */
  602. X+ #ifndef M_XENIX
  603. X        lseek (desc, sym_offset, L_SET);
  604. X+ 
  605. X        read_ofile_symtab (desc, stringtab, stringtab_size,
  606. X               pst->ldsymoff,
  607. X               pst->ldsymlen, pst->textlow,
  608. X               pst->texthigh - pst->textlow, 0);
  609. X+ #else  /* M_XENIX */
  610. X+       read_ofile_symtab (desc, stringtab + pst->stringtab_off,
  611. X+              stringtab_size - pst->stringtab_off,
  612. X+              pst->ldsymoff,
  613. X+              pst->ldsymlen, pst->textlow,
  614. X+              pst->texthigh - pst->textlow, 0);
  615. X+ #endif  /* M_XENIX */
  616. X        sort_symtab_syms (symtab_list); /* At beginning since just added */
  617. X  
  618. X        do_cleanups (old_chain);
  619. X***************
  620. X*** 2903,2909 ****
  621. X--- 3086,3094 ----
  622. X        if (desc < 0)
  623. X      error("Symbol file not readable");
  624. X  
  625. X+ #ifndef M_XENIX    
  626. X        READ_FILE_HEADERS (desc, name);
  627. X+ #endif /* M_XENIX */
  628. X  
  629. X        /* Read in the string table */
  630. X        lseek (desc, STRING_TABLE_OFFSET, L_SET);
  631. X***************
  632. X*** 3058,3063 ****
  633. X--- 3243,3249 ----
  634. X    symtab_input_desc = desc;
  635. X    symbuf_end = symbuf_idx = 0;
  636. X  
  637. X+ #ifndef M_XENIX
  638. X    /* It is necessary to actually read one symbol *before* the start
  639. X       of this symtab's symbols, because the GCC_COMPILED_FLAG_SYMBOL
  640. X       occurs before the N_SO symbol.
  641. X***************
  642. X*** 3087,3092 ****
  643. X--- 3273,3285 ----
  644. X        lseek(desc, sym_offset, L_INCR);
  645. X        processing_gcc_compilation = 0;
  646. X      }
  647. X+ #else /* M_XENIX */
  648. X+     lseek(desc, sym_offset, L_SET);
  649. X+     processing_gcc_compilation = 0;
  650. X+ #ifdef X_DEBUG
  651. X+     printf("sym_offset = %d,  sym_size = %d\n", sym_offset, sym_size);
  652. X+ #endif /* X_DEBUG */
  653. X+ #endif /* M_XENIX */
  654. X  
  655. X    if (symbuf_idx == symbuf_end)
  656. X      fill_symbuf();
  657. X***************
  658. X*** 3094,3099 ****
  659. X--- 3287,3298 ----
  660. X    if ((unsigned char) bufp->n_type != N_SO)
  661. X      fatal("First symbol in segment of executable not a source symbol");
  662. X  
  663. X+ #ifdef X_DEBUG
  664. X+ printf("%s = (%#x, %d, %#x)\n",
  665. X+   bufp->n_un.n_strx ? bufp->n_un.n_strx+stringtab : "<NONE>",
  666. X+   (unsigned char)bufp->n_type, bufp->n_desc, bufp->n_value);
  667. X+ #endif /* X_DEBUG */
  668. X+ 
  669. X    for (symnum = 0;
  670. X         symnum < sym_size / sizeof(struct nlist);
  671. X         symnum++)
  672. X***************
  673. X*** 3103,3108 ****
  674. X--- 3302,3312 ----
  675. X      fill_symbuf();
  676. X        bufp = &symbuf[symbuf_idx++];
  677. X        type = bufp->n_type;
  678. X+ #ifdef X_DEBUG
  679. X+ printf("%s = (%#x, %d, %#x)\n",
  680. X+   bufp->n_un.n_strx ? bufp->n_un.n_strx+stringtab : "<NONE>",
  681. X+   (unsigned char)bufp->n_type, bufp->n_desc, bufp->n_value);
  682. X+ #endif /* X_DEBUG */
  683. X  
  684. X        if (offset &&
  685. X        (type == N_TEXT || type == N_DATA || type == N_BSS))
  686. X***************
  687. X*** 3476,3481 ****
  688. X--- 3680,3687 ----
  689. X  
  690. X  /* Read in another .o file and create a symtab entry for it.*/
  691. X  
  692. X+ #ifndef M_XENIX /* Xenix can't do incremental loads */
  693. X+ 
  694. X  static void
  695. X  read_addl_syms (desc, stringtab, nlistlen, text_addr, text_size)
  696. X       int desc;
  697. X***************
  698. X*** 3772,3777 ****
  699. X--- 3978,3984 ----
  700. X    printf ("done.\n");
  701. X    fflush (stdout);
  702. X  }
  703. X+ #endif /* M_XENIX */
  704. X  
  705. X  /* Read a number by which a type is referred to in dbx data,
  706. X     or perhaps read a pair (FILENUM, TYPENUM) in parentheses.
  707. X***************
  708. X*** 5469,5476 ****
  709. X--- 5676,5685 ----
  710. X    add_com ("symbol-file", class_files, symbol_file_command,
  711. X         "Load symbol table (in dbx format) from executable file FILE.");
  712. X  
  713. X+ #ifndef M_XENIX
  714. X    add_com ("add-file", class_files, add_file_command,
  715. X             "Load the symbols from FILE, assuming its code is at TEXT_START.") ;
  716. X+ #endif /* M_XENIX */
  717. X  }
  718. X  
  719. X  #endif /* READ_DBX_FORMAT */
  720. X*** 3.5/gas-nlist.h
  721. X--- gas-nlist.h    Thu Aug  1 18:01:31 1991
  722. X***************
  723. X*** 0 ****
  724. X--- 1,13 ----
  725. X+ #define N_STAB 0340
  726. X+ 
  727. X+ struct gas_nlist {
  728. X+     union {
  729. X+         char    *n_name;
  730. X+         struct gas_nlist *n_next;
  731. X+         long    n_strx;
  732. X+     } n_un;
  733. X+     char    n_type;
  734. X+     char    n_other;
  735. X+     short    n_desc;
  736. X+     unsigned n_value;
  737. X+ };
  738. X*** 3.5/i386-dep.c    Thu Jan 11 00:58:05 1990
  739. X--- i386-dep.c    Thu Aug  1 18:01:33 1991
  740. X***************
  741. X*** 30,35 ****
  742. X--- 30,49 ----
  743. X  #include <sys/param.h>
  744. X  #include <sys/dir.h>
  745. X  #include <signal.h>
  746. X+ #ifdef M_XENIX
  747. X+ struct user; struct buf; struct inode; struct proc;    /* inhibit warnings */
  748. X+ #include <sys/page.h>
  749. X+ #include <sys/seg.h>
  750. X+ #define a_magic xa_magic
  751. X+ #define a_text xa_text
  752. X+ #define exec xexec
  753. X+ #undef U_FPSTATE
  754. X+ #define U_FPSTATE(u)    u.u_fps
  755. X+ #define fpstate u_fps
  756. X+ #define u_fpvalid u_fpsaved
  757. X+ unsigned short text_segid;    /* segment number of text segment */
  758. X+ unsigned short data_segid;    /* segment number of data segment */
  759. X+ #endif
  760. X  #include <sys/user.h>
  761. X  #include <sys/ioctl.h>
  762. X  #include <fcntl.h>
  763. X***************
  764. X*** 37,44 ****
  765. X--- 51,60 ----
  766. X  #ifdef COFF_ENCAPSULATE
  767. X  #include "a.out.encap.h"
  768. X  #else
  769. X+ #ifndef M_XENIX            /* already included by sys/user.h */
  770. X  #include <a.out.h>
  771. X  #endif
  772. X+ #endif
  773. X  
  774. X  #ifndef N_SET_MAGIC
  775. X  #ifdef COFF_FORMAT
  776. X***************
  777. X*** 50,57 ****
  778. X--- 66,94 ----
  779. X  
  780. X  #include <sys/file.h>
  781. X  #include <sys/stat.h>
  782. X+ #ifdef M_XENIX
  783. X+ #include <sys/proc.h>
  784. X+ #endif
  785. X  
  786. X  #include <sys/reg.h>
  787. X+ #ifdef M_XENIX
  788. X+ #define SS    RSS
  789. X+ #define UESP    RESP
  790. X+ #define EFL    REFL
  791. X+ #define CS    RCS
  792. X+ #define EIP    REIP
  793. X+ #define EAX    REAX
  794. X+ #define ECX    RECX
  795. X+ #define EDX    REDX
  796. X+ #define EBX    REBX
  797. X+ #define EBP    REBP
  798. X+ #define ESI    RESI
  799. X+ #define EDI    REDI
  800. X+ #define DS    RDS
  801. X+ #define ES    RES
  802. X+ #define FS    RFS
  803. X+ #define GS    RGS
  804. X+ #endif
  805. X  
  806. X  extern int errno;
  807. X  
  808. X***************
  809. X*** 62,68 ****
  810. X--- 99,120 ----
  811. X  call_ptrace (request, pid, arg3, arg4)
  812. X       int request, pid, arg3, arg4;
  813. X  {
  814. X+ #ifdef M_XENIX
  815. X+     extern CORE_ADDR text_end;
  816. X+     int addr_in_data_segment = arg3 > text_end;
  817. X+ #ifdef PTRACE_ADDR_ARG_STRUCT
  818. X+     struct saddr addr;
  819. X+     addr.sa_seg = addr_in_data_segment ? data_segid : text_segid;
  820. X+     if (request == 7 || request == 9) addr.sa_seg = 0;
  821. X+     addr.sa_off = arg3;
  822. X+     arg3 = (int) &addr;
  823. X+ #endif
  824. X+   if (addr_in_data_segment && (request == 1 || request == 4)) request++;
  825. X+   return ptrace (request, pid, arg3, arg4);
  826. X+ #define ptrace(a, b, c, d) call_ptrace(a, b, c, d)
  827. X+ #else
  828. X    return ptrace (request, pid, arg3, arg4);
  829. X+ #endif /* M_XENIX */
  830. X  }
  831. X  
  832. X  kill_inferior ()
  833. X***************
  834. X*** 157,163 ****
  835. X--- 209,220 ----
  836. X        perror_with_name (buf);
  837. X      }
  838. X      }
  839. X+ #ifdef M_XENIX
  840. X+ /* HACK: Xenix ptrace() disallows writing to where es, fs and gs are kept */
  841. X+   else for (regno = 0; regno < (NUM_REGS - 3); regno++)
  842. X+ #else
  843. X    else for (regno = 0; regno < NUM_REGS; regno++)
  844. X+ #endif
  845. X      {
  846. X        regaddr = register_addr (regno, offset);
  847. X        errno = 0;
  848. X***************
  849. X*** 382,389 ****
  850. X--- 439,451 ----
  851. X  
  852. X    data_start = 0;
  853. X    data_end = 0;
  854. X+ #ifdef M_XENIX
  855. X+   stack_start = 0;
  856. X+   stack_end = 0;
  857. X+ #else
  858. X    stack_start = STACK_END_ADDR;
  859. X    stack_end = STACK_END_ADDR;
  860. X+ #endif
  861. X  
  862. X    /* Now, if a new core file was specified, open it and digest it.  */
  863. X  
  864. X***************
  865. X*** 406,411 ****
  866. X--- 468,474 ----
  867. X      val = myread (corechan, &u, sizeof u);
  868. X      if (val < 0)
  869. X        perror_with_name (filename);
  870. X+ #ifndef M_XENIX
  871. X      data_start = exec_data_start;
  872. X  
  873. X      data_end = data_start + NBPG * u.u_dsize;
  874. X***************
  875. X*** 412,417 ****
  876. X--- 475,490 ----
  877. X      stack_start = stack_end - NBPG * u.u_ssize;
  878. X      data_offset = NBPG * UPAGES;
  879. X      stack_offset = NBPG * (UPAGES + u.u_dsize);
  880. X+ #else
  881. X+     data_start = (CORE_ADDR)u.u_sdata;
  882. X+     data_end = (CORE_ADDR)u.u_edatau;
  883. X+     stack_start = (CORE_ADDR)u.u_stktop;
  884. X+     stack_end = (CORE_ADDR)u.u_stkbotu;
  885. X+ 
  886. X+     data_offset = lseek(corechan, 0L, 2) - u.u_dsize;
  887. X+     stack_offset = (((sizeof u + (u.u_ldtlimit-1)*sizeof(struct descriptor)
  888. X+             + NBPC - 1) / NBPC) * NBPC);
  889. X+ #endif
  890. X      reg_offset = (int) u.u_ar0 - KERNEL_U_ADDR;
  891. X  
  892. X      /* I don't know where to find this info.
  893. X***************
  894. X*** 523,529 ****
  895. X--- 596,651 ----
  896. X      exec_mtime = file_hdr.f_timdat;
  897. X        }
  898. X  #else /* not COFF_FORMAT */
  899. X+ #ifdef M_XENIX
  900. X        {
  901. X+     char *extended_header;
  902. X+     struct xext *xext;
  903. X+     struct stat st_exec;
  904. X+     struct xseg xseg;
  905. X+     extern char *malloc();
  906. X+     val = myread (execchan, &exec_aouthdr, sizeof (AOUTHDR));
  907. X+ 
  908. X+     if (val < 0)
  909. X+       perror_with_name (filename);
  910. X+         if (exec_aouthdr.x_magic != X_MAGIC)
  911. X+       error ("\"%s\": not in executable format.", execfile);
  912. X+     if ( (exec_aouthdr.x_cpu & XC_CPU) != XC_386 )
  913. X+       error ("\"%s\": not a 386 executable.", execfile);
  914. X+     if ( (exec_aouthdr.x_renv & XE_SEG) == 0)
  915. X+       error ("\"%s\": not a segmented executable.", execfile);
  916. X+     if ( (exec_aouthdr.x_renv & XE_EXEC) == 0)
  917. X+       error ("\"%s\": not executable.", execfile);
  918. X+     extended_header = malloc(exec_aouthdr.x_ext);
  919. X+     val = myread (execchan, extended_header, exec_aouthdr.x_ext);
  920. X+     if (val < 0)
  921. X+       perror_with_name (filename);
  922. X+     xext = (struct xext *)extended_header;
  923. X+     lseek(execchan, xext->xe_segpos, 0);
  924. X+     if (myread (execchan, (char *)&xseg, sizeof(xseg)) < 0)
  925. X+       perror_with_name (filename);
  926. X+     if ( xseg.xs_type != XS_TTEXT )
  927. X+       error ("\"%s\": Text segment isn't first (huh?).", execfile);
  928. X+     text_segid = xseg.xs_seg;
  929. X+     text_start = xseg.xs_rbase;
  930. X+     text_end = text_start + xseg.xs_vsize;
  931. X+     text_offset = xseg.xs_filpos;
  932. X+ 
  933. X+     if (myread (execchan, (char *)&xseg, sizeof(xseg)) < 0)
  934. X+       perror_with_name (filename);
  935. X+     if ( xseg.xs_type != XS_TDATA )
  936. X+       error ("\"%s\": Data segment isn't second (huh?).", execfile);
  937. X+     data_segid = xseg.xs_seg;
  938. X+     exec_data_start = xseg.xs_rbase;
  939. X+     exec_data_end = exec_data_start + xseg.xs_psize;
  940. X+     exec_data_offset = xseg.xs_filpos;
  941. X+     data_start = exec_data_start;
  942. X+     data_end += exec_data_start;
  943. X+     
  944. X+     fstat (execchan, &st_exec);
  945. X+     exec_mtime = st_exec.st_mtime;
  946. X+     free(extended_header);
  947. X+       }
  948. X+ #else    /* not M_XENIX */
  949. X      struct stat st_exec;
  950. X  
  951. X  #ifdef HEADER_SEEK_FD
  952. X***************
  953. X*** 549,554 ****
  954. X--- 671,677 ----
  955. X      fstat (execchan, &st_exec);
  956. X      exec_mtime = st_exec.st_mtime;
  957. X        }
  958. X+ #endif /* not M_XENIX */
  959. X  #endif /* not COFF_FORMAT */
  960. X  
  961. X        validate_files ();
  962. X***************
  963. X*** 1056,1061 ****
  964. X--- 1179,1195 ----
  965. X  
  966. X  struct env387 
  967. X  {
  968. X+ #ifdef M_XENIX
  969. X+   unsigned int control;
  970. X+   unsigned int status;
  971. X+   unsigned int tag;
  972. X+   unsigned long eip;
  973. X+   unsigned short code_seg;
  974. X+   unsigned short operand_seg;
  975. X+   unsigned long opcode;
  976. X+   unsigned long operand;
  977. X+   unsigned char regs[8][10];
  978. X+ #else
  979. X    unsigned short control;
  980. X    unsigned short r0;
  981. X    unsigned short status;
  982. X***************
  983. X*** 1069,1074 ****
  984. X--- 1203,1209 ----
  985. X    unsigned short operand_seg;
  986. X    unsigned short r3;
  987. X    unsigned char regs[8][10];
  988. X+ #endif
  989. X  };
  990. X  
  991. X  static
  992. X***************
  993. X*** 1145,1150 ****
  994. X--- 1280,1289 ----
  995. X    int fpreg;
  996. X    unsigned char *p;
  997. X    
  998. X+ #ifdef M_XENIX
  999. X+   if (ep->status != 0) 
  1000. X+       print_387_status_word (ep->status);
  1001. X+ #else
  1002. X    bothstatus = ((status != 0) && (ep->status != 0));
  1003. X    if (status != 0) 
  1004. X      {
  1005. X***************
  1006. X*** 1159,1164 ****
  1007. X--- 1298,1304 ----
  1008. X      printf ("e: ");
  1009. X        print_387_status_word (ep->status);
  1010. X      }
  1011. X+ #endif
  1012. X    
  1013. X    print_387_control_word (ep->control);
  1014. X    printf ("last exception: ");
  1015. X***************
  1016. X*** 1188,1193 ****
  1017. X--- 1328,1334 ----
  1018. X        i387_to_double (ep->regs[fpreg], (char *)&val);
  1019. X        printf ("  %g\n", val);
  1020. X      }
  1021. X+ #ifndef M_XENIX
  1022. X    if (ep->r0)
  1023. X      printf ("warning: reserved0 is 0x%x\n", ep->r0);
  1024. X    if (ep->r1)
  1025. X***************
  1026. X*** 1196,1201 ****
  1027. X--- 1337,1343 ----
  1028. X      printf ("warning: reserved2 is 0x%x\n", ep->r2);
  1029. X    if (ep->r3)
  1030. X      printf ("warning: reserved3 is 0x%x\n", ep->r3);
  1031. X+ #endif
  1032. X  }
  1033. X  
  1034. X  #ifndef U_FPSTATE
  1035. X***************
  1036. X*** 1270,1275 ****
  1037. X--- 1412,1421 ----
  1038. X      }
  1039. X    
  1040. X    fpstatep = (struct fpstate *)(buf + skip);
  1041. X+ #ifdef M_XENIX
  1042. X+   print_387_status (0, (struct env387 *)fpstatep);
  1043. X+ #else
  1044. X    print_387_status (fpstatep->status, (struct env387 *)fpstatep->state);
  1045. X+ #endif
  1046. X  }
  1047. X  
  1048. X*** 3.5/infrun.c    Wed Jan 24 00:10:35 1990
  1049. X--- infrun.c    Thu Aug  1 18:01:35 1991
  1050. X***************
  1051. X*** 146,151 ****
  1052. X--- 146,156 ----
  1053. X  /* Needed by IN_SIGTRAMP on some machines (e.g. vax).  */
  1054. X  #include <sys/param.h>
  1055. X  /* Needed by IN_SIGTRAMP on some machines (e.g. vax).  */
  1056. X+ #ifdef M_XENIX
  1057. X+ struct user; struct buf; struct inode; struct proc;    /* inhibit warnings */
  1058. X+ #include <sys/page.h>
  1059. X+ #include <sys/seg.h>
  1060. X+ #endif
  1061. X  #include <sys/user.h>
  1062. X  
  1063. X  extern char *sys_siglist[];
  1064. X*** 3.5/m-xenix386.h
  1065. X--- m-xenix386.h    Thu Aug  1 18:01:35 1991
  1066. X***************
  1067. X*** 0 ****
  1068. X--- 1,30 ----
  1069. X+ /* SCO XENIX 386 version.  Mostly like System V/386 3.2 */
  1070. X+ #include "m-i386-sv32.h"
  1071. X+ 
  1072. X+ /* define this if your DEVELOPMENT system is older than 2.3 */
  1073. X+ /* #define PTRACE_ADDR_ARG_STRUCT */
  1074. X+ 
  1075. X+ #define const    /* workaround for SCO's include files */
  1076. X+ /* This machine doesn't have the siginterrupt call.  */
  1077. X+ #define NO_SIGINTERRUPT
  1078. X+ #define NAMES_HAVE_UNDERSCORE
  1079. X+ /* support dbx-style debugging in x.out executables produced by
  1080. X+    the accompanying port of GCC */
  1081. X+ #undef COFF_FORMAT
  1082. X+ #define READ_DBX_FORMAT
  1083. X+ #undef START_INFERIOR_TRAPS_EXPECTED
  1084. X+ #define START_INFERIOR_TRAPS_EXPECTED 2
  1085. X+ #undef KERNEL_U_ADDR
  1086. X+ #define KERNEL_U_ADDR 0x06000000
  1087. X+ #undef FIX_CALL_DUMMY
  1088. X+ #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, type)   \
  1089. X+ { \
  1090. X+     extern CORE_ADDR text_end; \
  1091. X+     int from, to, delta, loc; \
  1092. X+     loc = text_end - CALL_DUMMY_LENGTH; \
  1093. X+     from = loc + 5; \
  1094. X+     to = (int)(fun); \
  1095. X+     delta = to - from; \
  1096. X+     *(int *)((char *)(dummyname) + 1) = delta; \
  1097. X+ }
  1098. X+ #define CANNOT_EXECUTE_STACK
  1099. X*** 3.5/munch    Wed Jul  5 20:46:28 1989
  1100. X--- munch    Thu Aug  1 18:01:35 1991
  1101. X***************
  1102. X*** 5,17 ****
  1103. X  echo '/* Do not modify this file.  It is created automatically by "munch". */'
  1104. X  echo 'void initialize_all_files () {'
  1105. X  
  1106. X! if test "$1" = "-DSYSV" ; then
  1107. X      shift;
  1108. X      nm $* | egrep '^(.*[^a-zA-Z_]_|_)initialize_' | \
  1109. X      sed -e 's/^.*\(_initialize_[a-zA-Z0-9_]*\)[^a-zA-Z0-9_].*$/   \1 ();/'
  1110. X  else
  1111. X      nm -p $* | egrep 'T *__initialize_' | \
  1112. X      sed -e 's/^.*T *_*\(.*\)/    _\1 ();/'
  1113. X  fi
  1114. X  
  1115. X  echo '}'
  1116. X--- 5,22 ----
  1117. X  echo '/* Do not modify this file.  It is created automatically by "munch". */'
  1118. X  echo 'void initialize_all_files () {'
  1119. X  
  1120. X! if [ -f /xenix ]; then
  1121. X      shift;
  1122. X+     nm $* | egrep 'A *__initialize_' | \
  1123. X+     sed -e 's/^.*A *_*\(.*\)/    _\1 ();/'
  1124. X+ else if test "$1" = "-DSYSV" ; then
  1125. X+     shift;
  1126. X      nm $* | egrep '^(.*[^a-zA-Z_]_|_)initialize_' | \
  1127. X      sed -e 's/^.*\(_initialize_[a-zA-Z0-9_]*\)[^a-zA-Z0-9_].*$/   \1 ();/'
  1128. X  else
  1129. X      nm -p $* | egrep 'T *__initialize_' | \
  1130. X      sed -e 's/^.*T *_*\(.*\)/    _\1 ();/'
  1131. X+ fi
  1132. X  fi
  1133. X  
  1134. X  echo '}'
  1135. X*** 3.5/readline/Makefile    Thu Feb  8 07:05:33 1990
  1136. X--- readline/Makefile    Thu Aug  1 18:01:43 1991
  1137. X***************
  1138. X*** 38,44 ****
  1139. X  # A good alternative is gcc -traditional.
  1140. X  #CC = gcc -traditional
  1141. X  CC = cc
  1142. X! RANLIB = /usr/bin/ranlib
  1143. X  AR = ar
  1144. X  RM = rm
  1145. X  CP = cp
  1146. X--- 38,44 ----
  1147. X  # A good alternative is gcc -traditional.
  1148. X  #CC = gcc -traditional
  1149. X  CC = cc
  1150. X! RANLIB = /bin/ranlib
  1151. X  AR = ar
  1152. X  RM = rm
  1153. X  CP = cp
  1154. X*** 3.5/readline/readline.c    Sun Nov 26 22:31:36 1989
  1155. X--- readline/readline.c    Thu Aug  1 18:01:45 1991
  1156. X***************
  1157. X*** 68,73 ****
  1158. X--- 68,77 ----
  1159. X  
  1160. X  #define HACK_TERMCAP_MOTION
  1161. X  
  1162. X+ #ifdef M_XENIX
  1163. X+ #include <sys/ttold.h>
  1164. X+ #include <sys/ndir.h>
  1165. X+ #else
  1166. X  #ifndef SYSV
  1167. X  #include <sys/dir.h>
  1168. X  #else  /* SYSV */
  1169. X***************
  1170. X*** 79,84 ****
  1171. X--- 83,89 ----
  1172. X  #define d_namlen d_reclen
  1173. X  #endif  /* hpux */
  1174. X  #endif  /* SYSV */
  1175. X+ #endif
  1176. X  
  1177. X  /* Some standard library routines. */
  1178. X  #include "readline.h"
  1179. X*** 3.5/symtab.h    Fri Sep  8 01:59:14 1989
  1180. X--- symtab.h    Thu Aug  1 18:01:46 1991
  1181. X***************
  1182. X*** 149,154 ****
  1183. X--- 149,157 ----
  1184. X       to take a *lot* of time; check) or an error (and we don't care
  1185. X       how long errors take). */
  1186. X    int statics_offset, n_static_syms;
  1187. X+ #ifdef M_XENIX
  1188. X+   int stringtab_off;
  1189. X+ #endif /* M_XENIX */
  1190. X  };
  1191. X  
  1192. X  /* This is the list of struct symtab's that gdb considers current.  */
  1193. X*** 3.5/values.c    Sun Sep 10 04:39:19 1989
  1194. X--- values.c    Thu Aug  1 18:01:48 1991
  1195. X***************
  1196. X*** 1024,1028 ****
  1197. X  
  1198. X    add_info ("values", value_history_info,
  1199. X          "Elements of value history (around item number IDX, or last ten).");
  1200. X!   add_info_alias ("history", value_history_info, 0);
  1201. X  }
  1202. X--- 1024,1028 ----
  1203. X  
  1204. X    add_info ("values", value_history_info,
  1205. X          "Elements of value history (around item number IDX, or last ten).");
  1206. X! /*  add_info_alias ("history", value_history_info, 0); */
  1207. X  }
  1208. X*** 3.5/x386dbx.c
  1209. X--- x386dbx.c    Thu Aug  1 18:01:50 1991
  1210. X***************
  1211. X*** 0 ****
  1212. X--- 1,481 ----
  1213. X+ #include <stdio.h>
  1214. X+ #include <a.out.h>
  1215. X+ #include <fcntl.h>
  1216. X+ #include <sys/types.h>
  1217. X+ #include <sys/relsym.h>
  1218. X+ #include <sys/param.h>
  1219. X+ #include <sys/file.h>
  1220. X+ #include "defs.h"
  1221. X+ #include "param.h"
  1222. X+ #include "symtab.h"
  1223. X+ #include "gas-nlist.h"
  1224. X+ 
  1225. X+ 
  1226. X+ /* XENIX symbol segment shape definitions */
  1227. X+ 
  1228. X+ struct section2 {            /* File info table shape */
  1229. X+     short        segment;    /* segment number */
  1230. X+     CORE_ADDR    address;    /* start address for this file */
  1231. X+     unsigned short    textsize;    /* size of the text for this file */
  1232. X+     long        type3off;    /* offset to type3 records, psym tab */
  1233. X+     long        type4off;    /* offset to type4 records, nlist tab */
  1234. X+     long        type5off;    /* offset to type5 records, str tab */
  1235. X+     long        type6off;    /* offset to type6 records */
  1236. X+     unsigned short    type3sz;    /* size of type3 records */
  1237. X+     unsigned short    type4sz;    /* size of type4 records */
  1238. X+     unsigned short    type5sz;    /* size of type5 records */
  1239. X+     unsigned short    type6sz;    /* size of type6 records */
  1240. X+     char        filelen;    /* length of filename */
  1241. X+ };
  1242. X+ 
  1243. X+ /* psymtable (attribute 3) symbol segment shape */
  1244. X+ 
  1245. X+ struct psymbol_seg {
  1246. X+     long        address;    /* core address */
  1247. X+     short        segid;        /* segment number */
  1248. X+     short        typeid;        /* variable's type */
  1249. X+     char        varlen;        /* variable's length */
  1250. X+ /*    char        name[0];    trailing name varlen long */
  1251. X+ } record3;
  1252. X+ 
  1253. X+ /*  Info maintenance structures */
  1254. X+ 
  1255. X+ struct fileinfo {        /* per file info */
  1256. X+     CORE_ADDR    address;    /* start address for this file */
  1257. X+     unsigned short    textsize;    /* size of text for this file */
  1258. X+     long        psymoff;    /* psyms table */
  1259. X+     long        strtaboff;    /* string table aka $$TYPES */
  1260. X+     long        ntaboff;    /* nlist table aka $$SYMBOLS */
  1261. X+     unsigned short    psymsz;        /* size of psyms table */
  1262. X+     unsigned short    strtabsz;    /* size of string table */
  1263. X+     unsigned short    ntabsz;        /* size of nlist table */
  1264. X+     int        mscdebuginfo;    /* compiled with cc -g not gcc -g */
  1265. X+     char        *filename;    /* name of this file */
  1266. X+     struct fileinfo *next;
  1267. X+ };
  1268. X+ 
  1269. X+ static struct fileinfo *fi_table = 0;
  1270. X+ struct xseg *seg_table;
  1271. X+ long num_seg_table_entries;
  1272. X+ 
  1273. X+ #ifdef __GNUC__
  1274. X+ #define alloca __builtin_alloca
  1275. X+ #endif
  1276. X+ 
  1277. X+ #define IGNORE_ATTR (-1)
  1278. X+ 
  1279. X+ static read_fileinfo_table(fp, segsize, name)
  1280. X+ FILE *fp;
  1281. X+ int segsize;
  1282. X+ char *name;
  1283. X+ {
  1284. X+   extern char *strrchr(), *xmalloc();
  1285. X+   char *fi_name;
  1286. X+   char *filename;
  1287. X+   struct section2 fi_entry;
  1288. X+   struct fileinfo *fi;
  1289. X+ 
  1290. X+   fi_table = fi = (struct fileinfo *)xmalloc(sizeof(struct fileinfo));
  1291. X+   while (segsize > 0)
  1292. X+   {
  1293. X+     if ((fread((char *)&fi_entry.segment, sizeof(short), 1, fp) != 1)
  1294. X+       || (fread((char *)&fi_entry.address, sizeof(CORE_ADDR), 1, fp) != 1)
  1295. X+       || (fread((char *)&fi_entry.textsize, sizeof(unsigned short),1,fp) != 1)
  1296. X+       || (fread((char *)&fi_entry.type3off, sizeof(long), 1, fp) != 1)
  1297. X+       || (fread((char *)&fi_entry.type4off, sizeof(long), 1, fp) != 1)
  1298. X+       || (fread((char *)&fi_entry.type5off, sizeof(long), 1, fp) != 1)
  1299. X+       || (fread((char *)&fi_entry.type6off, sizeof(long), 1, fp) != 1)
  1300. X+       || (fread((char *)&fi_entry.type3sz, sizeof(unsigned short),1,fp) != 1)
  1301. X+       || (fread((char *)&fi_entry.type4sz, sizeof(unsigned short),1,fp) != 1)
  1302. X+       || (fread((char *)&fi_entry.type5sz, sizeof(unsigned short),1,fp) != 1)
  1303. X+       || (fread((char *)&fi_entry.type6sz, sizeof(unsigned short),1,fp) != 1)
  1304. X+       || (fread((char *)&fi_entry.filelen, sizeof(char), 1, fp) != 1))
  1305. X+       perror_with_name(name);
  1306. X+ 
  1307. X+     segsize -= sizeof(short) + sizeof(CORE_ADDR) + 5 * sizeof(unsigned short)
  1308. X+            + 4 * sizeof(long) + sizeof(char);
  1309. X+ 
  1310. X+     fi_name = alloca(fi_entry.filelen + 1);
  1311. X+     if (fread(fi_name, fi_entry.filelen, 1, fp) != 1)
  1312. X+       perror_with_name(name);
  1313. X+     fi_name[fi_entry.filelen] = '\0';
  1314. X+     segsize -= fi_entry.filelen;
  1315. X+ 
  1316. X+     if ((filename = strrchr(fi_name, '/')) != (char *)0)
  1317. X+       fi_name = filename + 1;
  1318. X+ 
  1319. X+     if ((filename = strrchr(fi_name, '(')) != (char *)0)
  1320. X+       fi_name = filename + 1;
  1321. X+ 
  1322. X+     if ((filename = strrchr(fi_name, ')')) != (char *)0)
  1323. X+         *filename = '\0';
  1324. X+    
  1325. X+     {
  1326. X+       int len = strlen(fi_name);
  1327. X+ 
  1328. X+       if (len > 2 && fi_name[len - 1] == 'o' && fi_name[len - 2] == '.')
  1329. X+       fi_name[len - 1] = 'c';
  1330. X+     }
  1331. X+ 
  1332. X+     fi_name = savestring(fi_name, strlen(fi_name) + 1);
  1333. X+ 
  1334. X+     fi->next = (struct fileinfo *)xmalloc(sizeof(struct fileinfo));
  1335. X+     fi = fi->next;
  1336. X+ 
  1337. X+     fi->address = fi_entry.address;
  1338. X+     fi->textsize = fi_entry.textsize;
  1339. X+     fi->psymoff = fi_entry.type3off;
  1340. X+     fi->psymsz = fi_entry.type3sz;
  1341. X+     fi->strtaboff = fi_entry.type4off;
  1342. X+     fi->strtabsz = fi_entry.type4sz;
  1343. X+     fi->ntaboff = fi_entry.type5off;
  1344. X+     fi->ntabsz = fi_entry.type5sz;
  1345. X+     fi->mscdebuginfo = (fi_entry.type6sz != 0);
  1346. X+     fi->filename = fi_name;
  1347. X+   }
  1348. X+   fi->next = 0;  fi = fi_table;  fi_table = fi_table->next;  free(fi);
  1349. X+ 
  1350. X+ #ifdef X_DEBUG
  1351. X+     printf("\naddress   textsz  symoff   symsz  stroff   strsz  taboff   tabsz  name\n\n");
  1352. X+   for (fi = fi_table; fi != 0; fi = fi->next)
  1353. X+   {
  1354. X+     printf("% 8x  % 6d  % 6d  % 6d  % 6d  % 6d  % 6d  %6d  %s\n", fi->address, fi->textsize, fi->psymoff, fi->psymsz, fi->strtaboff, fi->strtabsz, fi->ntaboff, fi->ntabsz, fi->filename);
  1355. X+   }
  1356. X+   printf("\n");
  1357. X+ #endif /* X_DEBUG */
  1358. X+ }
  1359. X+ 
  1360. X+ static read_seg_table(fp, pos, size, name)
  1361. X+ FILE *fp;
  1362. X+ long pos, size;
  1363. X+ {
  1364. X+   seg_table = (struct xseg *) xmalloc(size);
  1365. X+   fseek(fp, pos, 0);
  1366. X+   if (fread((char *)seg_table, size, 1, fp) != 1)
  1367. X+     perror_with_name(name);
  1368. X+   num_seg_table_entries = size / sizeof (struct xseg);
  1369. X+ }
  1370. X+ 
  1371. X+ 
  1372. X+ struct xseg *find_segment(type, attr)
  1373. X+ int type, attr;
  1374. X+ {
  1375. X+   struct xseg *cseg;
  1376. X+ 
  1377. X+   for (cseg = seg_table; cseg < seg_table + num_seg_table_entries; ++cseg)
  1378. X+   if (cseg->xs_type == type &&
  1379. X+     (attr == IGNORE_ATTR || attr == cseg->xs_attr))
  1380. X+     return cseg;
  1381. X+   return NULL;
  1382. X+ }
  1383. X+ 
  1384. X+ static int compare_misc_functions (fn1, fn2)
  1385. X+ struct misc_function *fn1, *fn2;
  1386. X+ {
  1387. X+   /* Return a signed result based on unsigned comparisons
  1388. X+      so that we sort into unsigned numeric order.  */
  1389. X+ 
  1390. X+   if (fn1->address < fn2->address)
  1391. X+     return -1;
  1392. X+   if (fn1->address > fn2->address)
  1393. X+     return 1;
  1394. X+   return 0;
  1395. X+ }
  1396. X+ 
  1397. X+ static int read_misc_functions(fp, segsize, name)
  1398. X+ FILE *fp;
  1399. X+ int segsize;
  1400. X+ char *name;
  1401. X+ {
  1402. X+   char *symdata, *p, *str_buff;
  1403. X+   long sym_count = 0, str_count = 0, i;
  1404. X+   struct misc_function *miscp;
  1405. X+   struct sym symb;
  1406. X+ 
  1407. X+   /* grab the symbol table */
  1408. X+ 
  1409. X+   symdata = alloca(segsize + 1);
  1410. X+   if (fread(symdata, segsize, 1, fp) != 1)
  1411. X+       perror_with_name(name);
  1412. X+ 
  1413. X+   /* first pass, work out how many symbols there are and the size of the
  1414. X+    * strings
  1415. X+    */
  1416. X+ 
  1417. X+   p = symdata;
  1418. X+   while (p < symdata + segsize)
  1419. X+   {
  1420. X+     int len;
  1421. X+ 
  1422. X+     p += sizeof(struct sym);
  1423. X+     len = strlen(p) + 1;
  1424. X+     str_count += len;  p += len;  sym_count++;
  1425. X+   }
  1426. X+ 
  1427. X+   /* Now build the misc function vector */
  1428. X+ 
  1429. X+   str_buff = xmalloc(str_count+1);
  1430. X+   misc_function_vector =
  1431. X+     (struct misc_function *) xmalloc (sym_count * sizeof(struct misc_function));
  1432. X+   misc_function_count = sym_count;
  1433. X+ 
  1434. X+   p = symdata;  miscp = misc_function_vector;
  1435. X+   while (p < symdata + segsize)
  1436. X+   {
  1437. X+     int len;
  1438. X+ 
  1439. X+     symb = *((struct sym *)p);
  1440. X+     p += sizeof(struct sym);
  1441. X+ 
  1442. X+     if (*p == '_')
  1443. X+       strcpy(str_buff, p+1);
  1444. X+     else
  1445. X+       strcpy(str_buff, p);
  1446. X+ 
  1447. X+     /* the following will result in a garbage byte every time a symbol
  1448. X+      * starts with a _, I can'y be bothered to fix it.
  1449. X+      */
  1450. X+ 
  1451. X+     miscp->name = str_buff;
  1452. X+     len = strlen(p) + 1;
  1453. X+     str_buff += len;  p += len;
  1454. X+     miscp->address = symb.s_value;
  1455. X+     switch(symb.s_type & S_TYPE)
  1456. X+     {
  1457. X+     case S_UNDEF:  miscp->type = mf_unknown;  break;
  1458. X+     case S_ABS:    miscp->type = mf_abs;  break;
  1459. X+     case S_TEXT:   miscp->type = mf_text;  break;
  1460. X+     case S_DATA:   miscp->type = mf_data;  break;
  1461. X+     case S_BSS:    miscp->type = mf_bss;  break;
  1462. X+     case S_COMM:   miscp->type = mf_data;  break;
  1463. X+     case S_REG:    miscp->type = mf_unknown;  break;
  1464. X+     case S_COMB:   miscp->type = mf_unknown;  break;
  1465. X+     case S_SEG:    miscp->type = mf_unknown;  break;
  1466. X+     case S_FN:     miscp->type = mf_unknown;  break;
  1467. X+     dewfault:      miscp->type = mf_unknown;  break;
  1468. X+     }
  1469. X+     miscp++;
  1470. X+   }
  1471. X+ 
  1472. X+   qsort (misc_function_vector, misc_function_count,
  1473. X+     sizeof (struct misc_function), compare_misc_functions);
  1474. X+ 
  1475. X+ #ifdef X_DEBUG
  1476. X+   {
  1477. X+     struct misc_function *miscp;
  1478. X+     int i;
  1479. X+ 
  1480. X+     printf("type      address  name\n\n");
  1481. X+     for (i = 0; i < misc_function_count; i++)
  1482. X+     {
  1483. X+       miscp = &misc_function_vector[i];
  1484. X+       switch (miscp->type)
  1485. X+       {
  1486. X+       case mf_unknown: printf("%-9s","unknown");  break;
  1487. X+       case mf_text:    printf("%-9s","text");  break;
  1488. X+       case mf_data:    printf("%-9s","data");  break;
  1489. X+       case mf_bss:     printf("%-9s","bss");  break;
  1490. X+       case mf_abs:     printf("%-9s","abs");  break;
  1491. X+       default:         printf("%-9s","UNKNOWN");  break;
  1492. X+       }
  1493. X+       printf("% 8x  ", miscp->address);
  1494. X+       printf("%s\n", miscp->name);
  1495. X+     }
  1496. X+   }
  1497. X+ #endif /* X_DEBUG */
  1498. X+   return misc_function_count;
  1499. X+ }
  1500. X+ 
  1501. X+ process_a_out(desc, name)
  1502. X+ int desc;
  1503. X+ char *name;
  1504. X+ {
  1505. X+   struct xexec exec_aouthdr;
  1506. X+   struct xext *xext;
  1507. X+   struct xseg *cseg;
  1508. X+   FILE *fp;
  1509. X+ 
  1510. X+   lseek(desc, 0L, 0);
  1511. X+   if ((fp = fdopen(dup(desc), "r")) == NULL)
  1512. X+         perror_with_name(name);
  1513. X+ 
  1514. X+   if (fread((char *)&exec_aouthdr, sizeof(struct xexec), 1, fp) != 1)
  1515. X+     perror_with_name(name);
  1516. X+   
  1517. X+   xext = (struct xext *) alloca(exec_aouthdr.x_ext);
  1518. X+   if (fread((char *)xext, exec_aouthdr.x_ext, 1, fp) != 1)
  1519. X+     perror_with_name(name);
  1520. X+   
  1521. X+   read_seg_table(fp, xext->xe_segpos, xext->xe_segsize, name);
  1522. X+ 
  1523. X+   if (cseg = find_segment(XS_TSYMS, 2))
  1524. X+   {
  1525. X+     fseek(fp, cseg->xs_filpos, 0);
  1526. X+     read_fileinfo_table(fp, cseg->xs_psize, name);
  1527. X+   }
  1528. X+ 
  1529. X+   fclose(fp);
  1530. X+ }
  1531. X+ 
  1532. X+ process_global_symbol_table(desc, name)
  1533. X+ int desc;
  1534. X+ char *name;
  1535. X+ {
  1536. X+   struct xseg *cseg;
  1537. X+   FILE *fp;
  1538. X+ 
  1539. X+   if ((fp = fdopen(dup(desc), "r")) == NULL)
  1540. X+         perror_with_name(name);
  1541. X+ 
  1542. X+   if (cseg = find_segment(XS_TSYMS, 1))
  1543. X+   {
  1544. X+     fseek(fp, cseg->xs_filpos, 0);
  1545. X+     read_misc_functions(fp, cseg->xs_psize, name);
  1546. X+   }
  1547. X+   fclose(fp);
  1548. X+ }
  1549. X+ 
  1550. X+ static struct fileinfo *current_fi;
  1551. X+ static int first_get_fileinfo_call = 1;
  1552. X+ 
  1553. X+ init_fileinfo_processing()  /* start processing the list of files */
  1554. X+ {
  1555. X+   first_get_fileinfo_call = 1;
  1556. X+ }
  1557. X+ 
  1558. X+ long get_next_fileinfo(stroff, nsyms, address, symtaboff, textsize)
  1559. X+ long *stroff, *nsyms, *address, *symtaboff, *textsize;
  1560. X+ {
  1561. X+   struct xseg *cseg;
  1562. X+ 
  1563. X+   if (first_get_fileinfo_call)
  1564. X+   {
  1565. X+     current_fi = fi_table;
  1566. X+     first_get_fileinfo_call = 0;
  1567. X+   }
  1568. X+   else
  1569. X+     current_fi = current_fi->next;
  1570. X+   
  1571. X+   if (current_fi == 0)
  1572. X+     return 0;
  1573. X+ 
  1574. X+   if (current_fi->mscdebuginfo)
  1575. X+   {
  1576. X+     *stroff = 0;
  1577. X+     *nsyms = 0;
  1578. X+     *address = current_fi->address;
  1579. X+     *textsize = current_fi->textsize;
  1580. X+   }
  1581. X+   else if (cseg = find_segment(XS_TSYMS, 5))
  1582. X+   {
  1583. X+     *symtaboff = cseg->xs_filpos + current_fi->ntaboff;
  1584. X+     *stroff = current_fi->strtaboff;
  1585. X+     *nsyms = current_fi->ntabsz / sizeof(struct gas_nlist);
  1586. X+     *address = current_fi->address;
  1587. X+     *textsize = current_fi->textsize;
  1588. X+     return 1;
  1589. X+   }
  1590. X+   else
  1591. X+   {
  1592. X+     *symtaboff = 0;
  1593. X+     *stroff = 0;
  1594. X+     *nsyms = 0;
  1595. X+     *address = 0;
  1596. X+     *textsize = 0;
  1597. X+   }
  1598. X+ }
  1599. X+ 
  1600. X+ #ifdef TEST
  1601. X+ 
  1602. X+ main()
  1603. X+ {
  1604. X+     char *stab;
  1605. X+     long str_offset, nsyms, address, ntaboff, textsize;
  1606. X+      int desc;
  1607. X+     struct xseg *cseg;
  1608. X+ 
  1609. X+     process_a_out((desc = open("a.out", O_RDONLY, 0)), "a.out");
  1610. X+ 
  1611. X+     printf("\n");
  1612. X+ 
  1613. X+            if (cseg = find_segment(XS_TSYMS, 4))
  1614. X+            {
  1615. X+         lseek(desc, cseg->xs_filpos, 0);
  1616. X+         stab = alloca(cseg->xs_psize);
  1617. X+         read(desc, stab, cseg->xs_psize);
  1618. X+       }
  1619. X+       else
  1620. X+         stab = 0;
  1621. X+ 
  1622. X+           init_fileinfo_processing();
  1623. X+       while (get_next_fileinfo(&str_offset,&nsyms,&address,&ntaboff,&textsize))
  1624. X+       {
  1625. X+         lseek(desc, ntaboff, 0);
  1626. X+         printf("\n  type    desc     value  stroff  string   tsize  (%#x)\n", address);
  1627. X+         while (nsyms--)
  1628. X+         {
  1629. X+           struct gas_nlist nl;
  1630. X+ 
  1631. X+           read(desc, &nl, sizeof(nl));
  1632. X+           printf("% 6x  % 6x  % 8x  % 6x  % 6x %s\n",
  1633. X+              (unsigned char)nl.n_type,
  1634. X+              (unsigned short)nl.n_desc,
  1635. X+              (unsigned int)nl.n_value,
  1636. X+              nl.n_un.n_strx ? stab + str_offset + nl.n_un.n_strx : "");
  1637. X+         }
  1638. X+         lseek(desc, 0L, 0);
  1639. X+       }
  1640. X+ }
  1641. X+ 
  1642. X+ perror_with_name (string)
  1643. X+      char *string;
  1644. X+ {
  1645. X+   extern int sys_nerr;
  1646. X+   extern char *sys_errlist[];
  1647. X+   extern int errno;
  1648. X+   char *err;
  1649. X+   char *combined;
  1650. X+ 
  1651. X+   if (errno < sys_nerr)
  1652. X+     err = sys_errlist[errno];
  1653. X+   else
  1654. X+     err = "unknown error";
  1655. X+ 
  1656. X+   combined = (char *) alloca (strlen (err) + strlen (string) + 3);
  1657. X+   strcpy (combined, string);
  1658. X+   strcat (combined, ": ");
  1659. X+   strcat (combined, err);
  1660. X+ 
  1661. X+   error ("%s.", combined);
  1662. X+ }
  1663. X+ 
  1664. X+ error (string, arg1, arg2, arg3)
  1665. X+      char *string;
  1666. X+      int arg1, arg2, arg3;
  1667. X+ {
  1668. X+   fflush (stdout);
  1669. X+   fprintf (stderr, string, arg1, arg2, arg3);
  1670. X+   fprintf (stderr, "\n");
  1671. X+   exit(1);
  1672. X+ }
  1673. X+ 
  1674. X+ char * xmalloc (size)
  1675. X+      long size;
  1676. X+ {
  1677. X+   register char *val = (char *) malloc (size);
  1678. X+   if (!val)
  1679. X+     error ("virtual memory exhausted.");
  1680. X+   return val;
  1681. X+ }
  1682. X+ 
  1683. X+ char *savestring (ptr, size)
  1684. X+      char *ptr;
  1685. X+      int size;
  1686. X+ {
  1687. X+   register char *p = (char *) xmalloc (size + 1);
  1688. X+   memcpy(p, ptr, size);
  1689. X+   p[size] = 0;
  1690. X+   return p;
  1691. X+ }
  1692. X+ 
  1693. X+ #endif /* TEST */
  1694. X*** gdbspace.asm
  1695. X--- gdbspace.asm    Thu Aug 22 20:27:38 1991
  1696. X***************
  1697. X*** 0 ****
  1698. X--- 1,14 ----
  1699. X+ ; GDB likes to poke calling sequences beyond _end -- in the padding
  1700. X+ ; space up to the end of the page.
  1701. X+ ; But XENIX doesn't let it use this space, so we have to add the space
  1702. X+ ; manually.  Assemble and install this file with the command
  1703. X+ ;    /usr/lib/storel gdbspace.asm && mv gdbspace.o /usr/local/lib/libgdb.a
  1704. X+ ; and use it by specifying -lgdb when you're debugging.
  1705. X+ ; e.g. gcc -g foo.c -o foo -lgdb
  1706. X+ ; This will enable you to do things like call functions from within gdb
  1707. X+     .386
  1708. X+ C_ETEXT    SEGMENT DWORD USE32 PUBLIC 'ENDCODE'
  1709. X+     PUBLIC    SPACE_FOR_GDB_TO_USE
  1710. X+ SPACE_FOR_GDB_TO_USE    DB    512    DUP    (0)
  1711. X+ C_ETEXT ENDS
  1712. X+     END
  1713. X
  1714. END_OF_FILE
  1715.   if test 46618 -ne `wc -c <'gdb-3.5b.pch'`; then
  1716.     echo shar: \"'gdb-3.5b.pch'\" unpacked with wrong size!
  1717.   fi
  1718.   # end of 'gdb-3.5b.pch'
  1719. fi
  1720. echo shar: End of archive.
  1721. exit 0
  1722. -- 
  1723. Steve.Bleazard@RoboBar.Co.Uk        | Phone:  +44 81 991 1142 x153
  1724. Snr Software Engineer, Robobar Ltd. | Fax:    +44 81 998 8343 (G3)
  1725. 22 Wadsworth Road, Perivale.        |
  1726. Middx., UB6 7JD ENGLAND.            | ...!ukc!robobar!steve
  1727.  
  1728. exit 0 # Just in case...
  1729. -- 
  1730. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1731. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1732. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1733. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1734.